package com.chao.storge.controller;

import com.chao.storge.service.StorgeInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : Rookie
 * @description :
 * @date : 2022/9/18
 */
@RestController
@RequestMapping("/storge")
public class StrogeController {

    @Autowired
    private StorgeInfoService storgeInfoService;

    @GetMapping("/deduct")
    public Boolean deductStorge(@RequestParam String productId, @RequestParam Integer count) {
        return storgeInfoService.deductStorge(productId, count);
    }
}
